package com.peng.controller;

import com.peng.pojo.Dept;
import com.peng.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class ConsumerController {
    @Autowired
    private DeptClientService service;

    @RequestMapping("/con/add")
    public boolean add(Dept dept){
        return service.addDept(dept);
    }
    @RequestMapping("/con/id/{id}")
    public Dept queryId(@PathVariable("id") long id){
        return service.queryId(id);
    }
    @RequestMapping("/con/all")
    public List<Dept> queryAll(){
        return service.queryList();
    }




}
